# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

cmake_minimum_required (VERSION 3.13)

project (azure-identity-samples LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED True)

if(MSVC)
  add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
endif()

add_executable(azure_cli_credential_sample azure_cli_credential.cpp)
target_link_libraries(azure_cli_credential_sample PRIVATE azure-identity service)
target_include_directories(azure_cli_credential_sample PRIVATE .)
target_compile_definitions(azure_cli_credential_sample PRIVATE _azure_BUILDING_SAMPLES)
create_per_service_target_build_for_sample(identity azure_cli_credential_sample)

add_executable(chained_token_credential_sample chained_token_credential.cpp)
target_link_libraries(chained_token_credential_sample PRIVATE azure-identity service)
target_include_directories(chained_token_credential_sample PRIVATE .)
target_compile_definitions(chained_token_credential_sample PRIVATE _azure_BUILDING_SAMPLES)
create_per_service_target_build_for_sample(identity chained_token_credential_sample)

add_executable(client_certificate_credential_sample client_certificate_credential.cpp)
target_link_libraries(client_certificate_credential_sample PRIVATE azure-identity service get-env-helper)
target_include_directories(client_certificate_credential_sample PRIVATE .)
target_compile_definitions(client_certificate_credential_sample PRIVATE _azure_BUILDING_SAMPLES)
create_per_service_target_build_for_sample(identity client_certificate_credential_sample)

add_executable(workload_identity_credential_sample workload_identity_credential.cpp)
target_link_libraries(workload_identity_credential_sample PRIVATE azure-identity service get-env-helper)
target_include_directories(workload_identity_credential_sample PRIVATE .)
target_compile_definitions(workload_identity_credential_sample PRIVATE _azure_BUILDING_SAMPLES)
create_per_service_target_build_for_sample(identity workload_identity_credential_sample)

add_executable(client_secret_credential_sample client_secret_credential.cpp)
target_link_libraries(client_secret_credential_sample PRIVATE azure-identity service get-env-helper)
target_include_directories(client_secret_credential_sample PRIVATE .)
target_compile_definitions(client_secret_credential_sample PRIVATE _azure_BUILDING_SAMPLES)
create_per_service_target_build_for_sample(identity client_secret_credential_sample DISABLE_RUN)

add_executable(default_azure_credential_sample default_azure_credential.cpp)
target_link_libraries(default_azure_credential_sample PRIVATE azure-identity service)
target_include_directories(default_azure_credential_sample PRIVATE .)
target_compile_definitions(default_azure_credential_sample PRIVATE _azure_BUILDING_SAMPLES)
create_per_service_target_build_for_sample(identity default_azure_credential_sample DISABLE_RUN)

add_executable(environment_credential_sample environment_credential.cpp)
target_link_libraries(environment_credential_sample PRIVATE azure-identity service)
target_include_directories(environment_credential_sample PRIVATE .)
target_compile_definitions(environment_credential_sample PRIVATE _azure_BUILDING_SAMPLES)
create_per_service_target_build_for_sample(identity environment_credential_sample)

add_executable(managed_identity_credential_sample managed_identity_credential.cpp)
target_link_libraries(managed_identity_credential_sample PRIVATE azure-identity service azure-storage-blobs)
target_include_directories(managed_identity_credential_sample PRIVATE .)
target_compile_definitions(managed_identity_credential_sample PRIVATE _azure_BUILDING_SAMPLES)
create_per_service_target_build_for_sample(identity managed_identity_credential_sample)
